package com.wit.witmg.api;


import com.wit.witmg.service.ITMatOutputService;
import com.wit.witmg.service.ITOrgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author bob
 * @since 2025-01-16
 */
@RestController
@RequestMapping("matOutput")
@Api(tags = "领料出库API")
public class MatOutputController {
    @Resource
    private ITMatOutputService service;

    @ApiOperation("添加")
    @PostMapping("add")
    public Object add(HttpServletRequest request,
                      @RequestParam("json") String json) {
        return service.add(request,json);
    }

    @ApiOperation("获取")
    @PostMapping("get")//参数：pid或bn或size或store返回数组；id返回单条数据。
    public Object get(HttpServletRequest request,
                      @RequestParam(value = "eid",required = false) Long eid,
                      @RequestParam(value = "oid",required = false) Integer oid,
                      @RequestParam(value = "bn",required = false) String bn,
                      @RequestParam(value = "pid",required = false) Integer pid) {
        return service.get(request,eid,oid,pid,bn);
    }

}
